/*
 * @Author: dengyl
 * @Date: 2022-01-24 10:30:54
 * @LastEditTime: 2022-04-21 14:20:02
 * @LastEditors: 詹真琦(legendryztachi@gmail.com)
 * @Description: 暂存待办
 * @FilePath: \code\cwp-front\pc-collaboration\src\handles\handle-list\summary\modules\comment.js
 */
import submit from './continue-submit';
import globalData from '@/plugins/data';
import {fireEvent, getCollEventParams} from "@/handles/common/sdk";
import {useBaseInfoStore} from "@/store/modules/base-info";

export async function comment(btn) {
    //按照不验证的提交处理
    await submit.call(this, btn);
}

export default function (btn) {
    return new Promise(async (resolve) => {
        const businessData = useBaseInfoStore().baseInfo?.businessData || {};
        const eventParams = getCollEventParams(businessData, globalData);
        let eventResult = await fireEvent("Comment", eventParams);
        if (!eventResult) {
            return resolve();
        }
        await comment.call(this, btn);
        resolve();
    });
}
